/**
 * 
 */
package TestCases;

import Tracer.RTHitpointObjMap;
import Tracer.RTVector;
import XMLScene.RTIObject;
import XMLScene.RTSphere;
import junit.framework.TestCase;

/**
 * @author Eagle
 * 
 */
public class RTHitpointObjMapTest extends TestCase {

	RTVector hitpoint;
	RTVector hitNormal;
	RTIObject hitObject;

	RTHitpointObjMap objMap;

	/**
	 * @param name
	 */
	public RTHitpointObjMapTest(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		super.setUp();

		hitpoint = new RTVector(1, 2, 3);
		hitNormal = new RTVector(0, 1, 0);
		hitObject = new RTSphere(hitpoint, 1);
		objMap = new RTHitpointObjMap(hitpoint, hitNormal, hitObject);
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	/**
	 * Test method for getHitPoint Test it works well after performing
	 * getHitPoint
	 */
	public void testGetHitPoint() {
		assertTrue(hitpoint.isEqual(objMap.getHitPoint()));
	}

	/**
	 * Test method for getHitNormal Test it works well after performing
	 * getHitNormal
	 */
	public void testGetHitNormal() {
		assertTrue(hitNormal.isEqual(objMap.getHitNormal()));
	}

	/**
	 * Test method for getHitObject Test it works well after performing
	 * getHitObject
	 */
	public void testGetHitObject() {
		assertNotNull(objMap.getHitObject());
	}

	/**
	 * Test method for setHitPoint Test it works well after performing
	 * setHitPoint
	 */
	public void testSetHitPoint() {
		RTHitpointObjMap a = new RTHitpointObjMap();
		a.setHitPoint(hitpoint);
		assertTrue(hitpoint.isEqual(a.getHitPoint()));
	}

	/**
	 * Test method for setHitNormal Test it works well after performing
	 * setHitNormal
	 */
	public void testSetHitNormal() {
		RTHitpointObjMap a = new RTHitpointObjMap();
		a.setHitNormal(hitNormal);
		assertTrue(hitNormal.isEqual(a.getHitNormal()));
	}

	/**
	 * Test method for setHitObject Test it works well after performing
	 * setHitObject
	 */
	public void testSetHitObject() {
		RTSphere obj = new RTSphere(hitpoint, 1);
		RTHitpointObjMap a = new RTHitpointObjMap();
		a.setHitObject(obj);
		assertNotNull(a.getHitObject());
	}

}
